package exam3;

import java.util.ArrayList;

public class PageTable {
    private ArrayList<Page> list = new ArrayList<>();

    public void add(Page page){
        list.add(page);
    }

    public void remove(Page page){
        list.remove(page);
    }

    public ArrayList<Page> getList() {
        return list;
    }

    public Page find(int pageNum){
        for (Page page:list){
            if (page.getPageNum() == pageNum){
                return page;
            }
        }
        return null;
    }
}
